<template>
  <!-- 查看设备组件 -->
  <el-dialog
    title="设备检查项信息"
    :visible.sync="showEquip"
    width="30%"
    class="dialogRec"
    :before-close="closeDialog"
  >
    <div class="facility-list">
      <div
        v-for="(item, index) in equipData"
        :key="index"
        class="facility-item"
      >
        <div class="info-line">
          <div class="name">设备名称：</div>
          <div class="value">{{ item.equipmentName }}</div>
        </div>
        <div class="info-line">
          <div class="name">检查内容：</div>
          <div>
            <div
              v-for="(checkItemContent,index2) in item.checkItemContentList"
              :key="index2"
              class="value"
            >{{ checkItemContent.checkItemContent }}</div>
          </div>
        </div>
      </div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button class="zh-button-one" @click="closeDialog">关 闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  props: {
    isShowEquip: {
      type: Boolean,
    },
    equipData: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      showEquip: false,
    };
  },
  watch: {
    isShowEquip: {
      handler(val) {
        // console.log(val, '222222222222222222')
        this.showEquip = val;
      },
    },
  },
  created() {
    this.showEquip = this.isShowEquip;
  },
  methods: {
    closeDialog() {
      this.showEquip = false;
      this.$emit("closeDialog");
    },
  },
};
</script>

<style scoped lang='scss'>
.dialogRec.el-dialog__wrapper {
  ::v-deep .el-dialog {
    height: auto;
    // width: 33% !important;
    .el-dialog__body {
      height: auto;
      overflow-y: auto;
      text-align: center;
      font-size: 18px;
      // color: red;
      letter-spacing: 2px;
      font-weight: 600;
      span {
        line-height: 100px;
      }
    }
    .el-dialog__footer {
      .Reconfirmation {
        background-color: #096f8f;
        border-radius: 6px;
      }
      .correct {
        background-color: #fff;
        color: #096f8f;
        border-radius: 6px;
        border: 1px solid #096f8f;
      }
    }
  }
}
.facility-list {
  display: flex;
  justify-content: flex-start;
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
  .facility-item {
    width: 100%;
    margin-right: 3%;
    margin-bottom: 10px;
    // height: 80px;
    border-radius: 5px;
    // border: 1px solid #ccc;
    box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.15);
    padding: 10px 20px;

    .info-line,
    .info-line2 {
      display: flex;
      justify-content: flex-start;
      align-items: flex-start;
      font-size: 14px;
      &:not(:last-child) {
        margin-bottom: 10px;
      }
      .name {
        text-align: left;
        width: 80px;
        flex-shrink: 0;
      }
      .value {
        width: 80%;
        text-align: left;
        font-weight: normal;
      }
    }
    .info-line2 {
      display: block;
    }
  }
}
</style>
